//
//  GraphicSystem.h
//  TrackingSim
//
//  Created by Garrett Manka on 11/25/11.
//  Copyright (c) 2011. All rights reserved.
//

#ifndef TrackingSim_GraphicSystem_h
#define TrackingSim_GraphicSystem_h

#ifdef _WIN32

#include <glut.h>

#else

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGl/glext.h>
#include <GLUT/glut.h>

#endif

#include <map>

class ObjLoader;

namespace Sim
{
    class Camera;
    class KinematicSim;
    class Player;
    
    class GraphicSystem
    {
    private:
        
        GraphicSystem(KinematicSim* kinematicsim);
        ~GraphicSystem();
        
    public:
        
        static void create(KinematicSim* kinematicsim);
        static GraphicSystem* getGS();
        
        static void start( int argc, char** argv );
        
        static void display();
        static void handleResize( int w, int h );
        static void keyboard( unsigned char key, int x, int y );
        static void mouseMoveFunc( int x, int y );
        static void idleFunc();
        
        static void drawMesh(const std::string& mesh_name);
        static void drawAxesOnPlayer(const Player* player);
        static void createDisplayLists();
        
        static void moveCursor(int& x, int& y);
        
    private:
        
        static GraphicSystem* s_the_instance;
        static bool s_instance_created;
        
        static const int window_width;
        static const int window_height;
        
        static KinematicSim* s_kinematicsim;
        static Camera* s_camera;
        
        static GLuint the_scene;
        static std::map<std::string, GLuint> s_list_to_resource_name_map;
    };
}

#endif
